// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

/**
 * 零售管理
 */
// 零售出库
import Goods from '@/views/goods/Goods';
// 零售退货
import center from '@/views/goods/center';


/**
 * 采购管理
 */
// 采购订单
import Order from '@/views/pay/Order';
// 采购出库
import Delivery from '@/views/pay/PurchaseDelivery';
// 采购退货
import Refund from '@/views/pay/PurchaseRefund';

// /**
//  * 销售管理
//  */
// // 销售订单
// import user from '@/views/system/user';
// // 销售入库
// import Module from '@/views/system/Module';
// // 销售出库
// import Role from '@/views/system/Role';

/**
 * 仓库管理
 */
// 其他入库
import Dept from '@/views/system/Dept';
// 其他出库
import OtherDelivery from '@/views/system/OtherDelivery';

/**
 * 财务管理
 */
// 收入单
import MachineConfig from '@/views/machine/MachineConfig';
// 支出单
import PaymentDom from '@/views/machine/PaymentDom';
// 收款单
import ReceiptDom from '@/views/machine/ReceiptDom';
// 付款单
import PayingDom from '@/views/machine/PayingDom';
// 转账单
import TransferDom from '@/views/machine/TransferDom';
// 收预付款
import PrePayment from '@/views/machine/PrePayment';

/** 
 * 报表查询
 */

// 商品库存
import statistics from '@/views/charts/statistics';
// 账户统计
import Config from '@/views/pay/Config';
// 采购统计
import Permission from '@/views/system/Permission';
// 入库明细
import user from '@/views/system/user';
// 入库汇总
import Module from '@/views/system/Module';
// 存库预警
import Role from '@/views/system/Role';

/**
 * 商品管理
 */
// 商品类别
import ProductClass from '@/views/product/ProductClass';
// 商品信息
import ProductMessage from '@/views/product/ProductMessage';
// 序列号
import SerialNumber from '@/views/product/SerialNumber';

/**
 * 基本资料
 */
// 供应商信息
import supplieMessage from '@/views/BasicInformation/supplieMessage';
// 客户信息
import clientMessage from '@/views/BasicInformation/clientMessage';
// 仓库信息
import storeMessage from '@/views/BasicInformation/storeMessage';
// 收支项目
import SzProject from '@/views/BasicInformation/SzProject';
// 结算账户
import CloseAccount from '@/views/BasicInformation/CloseAccount';
/**
 * 系统管理
 */
// 角色管理
import RoleAdmin from '@/views/SystemAdmin/RoleAdmin';
// 用户管理
import UserAdmin from '@/views/SystemAdmin/UserAdmin';
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '零售管理',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/goods/Goods',
            name: '零售出库',
            component: Goods,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/goods/center',
            name: '零售入库',
            component: center,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/pay/Order',
            name: '采购订单',
            component: Order,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/pay/PurchaseDelivery',
            name: '采购出库',
            component: Delivery,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/pay/PurchaseRefund',
            name: '采购退货',
            component: Refund,
            meta: {
                requireAuth: true
            }
        }, 
        
        {
            path: '/system/Dept',
            name: '其他入库',
            component: Dept,
            meta: {
                requireAuth: true
            }
        },{
            path: '/system/OtherDelivery',
            name: '其他出库',
            component: OtherDelivery,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/machine/MachineConfig',
            name: '收入单',
            component: MachineConfig,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/machine/PaymentDom',
            name: '支出单',
            component: PaymentDom,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/machine/ReceiptDom',
            name: '收款单',
            component: ReceiptDom,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/machine/PayingDom',
            name: '付款单',
            component: PayingDom,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/machine/TransferDom',
            name: '转账单',
            component: TransferDom,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/machine/PrePayment',
            name: '收预付款',
            component: PrePayment,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/system/Permission',
            name: '采购统计',
            component: Permission,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/pay/Config',
            name: '账户统计',
            component: Config,
            meta: {
                requireAuth: true
            }
        },{
            path: '/charts/statistics',
            name: '商品库存',
            component: statistics,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/system/user',
            name: '入库明细',
            component: user,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/system/Module',
            name: '入库汇总',
            component: Module,
            meta: {
                requireAuth: true
            }
        },
         {
            path: '/system/Role',
            name: '存库预警',
            component: Role,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/product/ProductClass',
            name: '商品类别',
            component: ProductClass,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/product/ProductMessage',
            name: '商品信息',
            component: ProductMessage,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/product/SerialNumber',
            name: '序列号',
            component: SerialNumber,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/BasicInformation/SzProject',
            name: '收支项目',
            component: SzProject,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/BasicInformation/CloseAccount',
            name: '结算账户',
            component: CloseAccount,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/BasicInformation/supplieMessage',
            name: '供应商信息',
            component: supplieMessage,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/BasicInformation/clientMessage',
            name: '客户信息',
            component: clientMessage,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/BasicInformation/storeMessage',
            name: '仓库信息',
            component: storeMessage,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/SystemAdmin/RoleAdmin',
            name: '角色管理',
            component: RoleAdmin,
            meta: {
                requireAuth: true
            }
        }, 
        {
            path: '/SystemAdmin/UserAdmin',
            name: '用户管理',
            component: UserAdmin,
            meta: {
                requireAuth: true
            }
        }, 
    ]
    }]
})